#ifndef _USER_UART_H__
#define _USER_UART_H__
#include "at32f413_usart.h"
#include "at32f413_gpio.h"
#include "at32f413.h"
#include "stdio.h"
#include  "stdlib.h"
#include <string.h>

#include "at32f413_dma.h"

#define PRINT_UART USART1
#define PRINT_UART_CRM_CLK CRM_USART1_PERIPH_CLOCK
#define PRINT_UART_TX_PIN GPIO_PINS_6
#define PRINT_UART_RX_PIN GPIO_PINS_7
#define PRINT_UART_TX_GPIO GPIOB
#define PRINT_UART_TX_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK

#define USART1_BUFFER_SIZE 256
#define USART_REC_LEN 512
extern void uart_print_init(uint32_t baudrate);
void usart1_txdatas(u8 *SendData,u16 len);


struct Muart {
	u8 Uartrxbuf[USART_REC_LEN];	//½ÓÊÕbuf
	u8 Uarttxbuf[USART_REC_LEN];	//·¢ËÍbuf
	u8 Uartrxsta;					//½ÓÊÕ×´Ì¬
	u16 Uartrxcut;					//½ÓÊÕÊý¾Ý¼ÆÊý£¨³¤¶È£©
	u16 Uarttxcut;					//·¢ËÍÊý¾Ý³¤¶È
};

extern struct Muart Muart_user;
void usartdmasend(u8 *data,u16 len);





#endif